package com.nciae.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nciae.enums.OrderStatusEnum;
import com.nciae.enums.PayStatusEnum;
import com.nciae.utils.GeneratePrimeKey;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author YangChen
 * @since 2021-10-14
 */
@TableName("order_master")
public class OrderMaster implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "order_id")
    private String orderId = GeneratePrimeKey.getkey();

    /**
     * 买家名字
     */
    @TableField(value = "buyer_name")
    private String buyerName;

    /**
     * 买家电话
     */
    @TableField(value = "buyer_phone")
    private String buyerPhone;

    /**
     * 买家地址
     */
    @TableField(value = "buyer_address")
    private String buyerAddress;

    /**
     * 买家微信openid
     */
    @TableField(value = "buyer_openid")
    private String buyerOpenid;

    /**
     * 订单总金额
     */
    @TableField(value = "order_amount")
    private BigDecimal orderAmount;

    /**
     * 订单状态，默认0新下单
     */
    @TableField(value = "order_status")
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();

    /**
     * 支付状态，默认0为未支付
     */
    @TableField(value = "pay_status")
    private Integer payStatus = PayStatusEnum.WAIT.getCode()    ;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime = new Date();

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private Date updateTime = new Date();

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }
    public String getBuyerPhone() {
        return buyerPhone;
    }

    public void setBuyerPhone(String buyerPhone) {
        this.buyerPhone = buyerPhone;
    }
    public String getBuyerAddress() {
        return buyerAddress;
    }

    public void setBuyerAddress(String buyerAddress) {
        this.buyerAddress = buyerAddress;
    }
    public String getBuyerOpenid() {
        return buyerOpenid;
    }

    public void setBuyerOpenid(String buyerOpenid) {
        this.buyerOpenid = buyerOpenid;
    }
    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }
    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }
    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "OrderMaster{" +
            "orderId=" + orderId +
            ", buyerName=" + buyerName +
            ", buyerPhone=" + buyerPhone +
            ", buyerAddress=" + buyerAddress +
            ", buyerOpenid=" + buyerOpenid +
            ", orderAmount=" + orderAmount +
            ", orderStatus=" + orderStatus +
            ", payStatus=" + payStatus +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
